import request from '@/utils/request'

export function get(data) {
  return request({
    url: '/api/slipHandover/detail',
    method: 'get',
    params: data
  })
}
// 抽单或追加
export function drawOrders(data) {
  return request({
    url: '/api/slipHandover/drawOrders',
    method: 'get',
    params: data
  })
}
// 审核反审
export function passOrReject(data) {
  return request({
    url: '/api/slipHandover/passOrReject',
    method: 'post',
    data
  })
}
// 删除
export function removeDetails(data) {
  return request({
    url: '/api/slipHandover/removeDetails',
    method: 'post',
    data
  })
}
// 回收
export function recycle(data) {
  return request({
    url: '/api/slipHandover/recycle',
    method: 'post',
    data
  })
}
// 结算
export function settle(data) {
  return request({
    url: '/api/slipHandover/settle',
    method: 'post',
    data
  })
}
// 明细页追加保存
export function saveDetails(data) {
  return request({
    url: '/api/slipHandover/saveDetails',
    method: 'post',
    data
  })
}
// 列表页新增保存
export function saveOrder(data) {
  return request({
    url: '/api/slipHandover/saveOrder',
    method: 'post',
    data
  })
}
// 明细页新增保存
export function save(data) {
  return request({
    url: '/api/slipHandover/edit',
    method: 'post',
    data
  })
}
// 打印
export function print(data) {
  return request({
    url: '/api/slipHandover/print',
    method: 'post',
    responseType:'blob',
    data
  })
}
export function slipCollectPrint(data) {
  const obj = {
    url: '/api/slipHandover/slipCollectPrint',
    method: 'post',
    responseType: 'blob',
    data
  }
  return request(obj)
}
// 删除单据
export function del(data) {
  return request({
    url: '/api/slipHandover',
    method: 'delete',
    data
  })
}

export default{ get,passOrReject,removeDetails,settle,recycle,drawOrders,saveDetails,saveOrder,save,del,print,slipCollectPrint}